﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace LogSystem
{
    class Program
    {
        static void Main(string[] args)
        {
            ////LogSys.CreateConfigrationXML(@"C:\Users\Administrator\Desktop\LogSysTest\LogConfig.xml");
            ////LogSys.InitializeLogSystem(@"C:\Users\Administrator\Desktop\LogSysTest\LogConfig.xml");
            ////LogSys.Log(LogLevel.Info, "hello");
            ////LogSys.Log(LogLevel.Info, "hello");
            //System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(1, true);
            //int x = st.GetFrame(0).GetFileLineNumber();
            //x = st.GetFrame(0).GetFileLineNumber();
            //while (true)
            //{
            //    LogSys.Log(LogLevel.Info, "hello");
            //    LogSys.Log(LogLevel.Info, "hello");
            //    if (Console.ReadLine() == "quit")
            //    {
            //        break;
            //    }
            //}

            //LogSys.DeInitializeLogSystem();
            Console.WriteLine("Hello World");
            FileStream fs1 = new FileStream("Test.txt", FileMode.Create);
            // First, save the standard output.
            TextWriter tmp = Console.Out;
            StreamWriter sw1 = new StreamWriter(fs1);
            Console.SetOut(sw1);
            Console.WriteLine("Hello file");
            Console.SetOut(tmp);
            Console.WriteLine("Hello World");
            sw1.Close();
        }
    }
}
